package classexercise;

public class LearnEnum {

	public static void main(String[] args) {
		goTrafficLight(TrafficLight.Red);
		goTrafficLight(TrafficLight.Green);
		goTrafficLight(TrafficLight.Yellow);
		goDirection(Direction.SOUTH);
		goDirection(Direction.EAST);
		goDirection(Direction.WEST);
		goDirection(Direction.NORTH);
		goPoker(Poker.Block);
		goPoker(Poker.Heart);
		goPoker(Poker.Plum);
		goPoker(Poker.Spade);
	}

	public static void goTrafficLight(TrafficLight trafficlight) {
		if (trafficlight == TrafficLight.Green) {
			System.out.println(TrafficLight.Green.getLightName() + ":" + TrafficLight.Green.getMeaning());
		} else if (trafficlight == TrafficLight.Red) {
			System.out.println(TrafficLight.Red.getLightName() + ":" + TrafficLight.Red.getMeaning());
		} else if (trafficlight == TrafficLight.Yellow) {
			System.out.println(TrafficLight.Yellow.getLightName() + ":" + TrafficLight.Yellow.getMeaning());
		}

	}

	public static void goDirection(Direction direction) {
		if (direction == Direction.EAST) {
			System.out.println(Direction.EAST.getName() + ":" + Direction.EAST.getMeaning());
		} else if (direction == Direction.SOUTH) {
			System.out.println(Direction.SOUTH.getName() + ":" + Direction.SOUTH.getMeaning());
		} else if (direction == Direction.WEST) {
			System.out.println(Direction.WEST.getName() + ":" + Direction.WEST.getMeaning());
		} else if (direction == Direction.NORTH) {
			System.out.println(Direction.NORTH.getName() + ":" + Direction.NORTH.getMeaning());
		}
	}

	public static void goPoker(Poker poker) {
		if (poker == Poker.Block) {
			System.out.println(Poker.Block.getPokerName() + ":" + Poker.Block.getPokerMeaning());
		} else if (poker == Poker.Heart) {
			System.out.println(Poker.Heart.getPokerName() + ":" + Poker.Heart.getPokerMeaning());
		} else if (poker == Poker.Plum) {
			System.out.println(Poker.Plum.getPokerName() + ":" + Poker.Plum.getPokerMeaning());
		} else if (poker == Poker.Spade) {
			System.out.println(Poker.Spade.getPokerName() + ":" + Poker.Spade.getPokerMeaning());
		}
	}

}
